<template>
	<view>
		<view class="address-picker" style="padding:0 24upx;">
        <view class="form-title text-more">{{item.form.name?item.form.name:'表单信息'}}</view>
        <view class="form-list">
            <view class="form-one flex-row" v-for="(form,formId) in item.form.list" :key="form.id">
                <view :class="['flex-grow-0 list-name', form.type=='text'?'flex-y-center':'', form.required==1?'required':'']">{{form.name}}</view>
                <view class="flex-grow-1 flex-y-center" v-if="form.type=='text'">
                    <input @confirm="$emit('formInput',$event)" @input="$emit('formInput',$event)" @blur="$emit('formInput',$event)" :data-form-id="formId" :data-index="index" :placeholder="form.tip" type="text" :value="form.default"></input>
                </view>
                <view class="flex-grow-1" v-if="form.type=='textarea'">
                    <textarea autoHeight="true" @confirm="$emit('formInput',$event)" @input="$emit('formInput',$event)" @blur="$emit('formInput',$event)" :data-form-id="formId" :data-index="index" :placeholder="form.tip" style="width:auto;max-height:400upx;height:auto" :value="form.default"></textarea>
                </view>
                <block v-if="form.type=='time'">
                    <view class="flex-grow-1" style="justify-content:flex-end;text-align:right;">
                        <picker @change="$emit('formInput',$event)" :data-form-id="formId" :data-index="index" end="23:59" mode="time" start="00:00" :value="form.default?form.default:'00:00'">
                            <view>{{form.default?form.default:'请选择'}}</view>
                        </picker>
                    </view>
                    <view class="flex-grow-0">
                        <image class="right-jiantou" :src="__wxapp_img.dapp.jiantou_r.url"></image>
                    </view>
                </block>
                <block v-if="form.type=='date'">
                    <view class="flex-grow-1" style="justify-content:flex-end;text-align:right;">
                        <picker @change="$emit('formInput',$event)" :data-form-id="formId" :data-index="index" mode="date" :start="time" :value="form.default?form.default:time">
                            <view>{{form.default?form.default:'请选择'}}</view>
                        </picker>
                    </view>
                    <view class="flex-grow-0">
                        <image class="right-jiantou" :src="__wxapp_img.dapp.jiantou_r.url"></image>
                    </view>
                </block>
                <view class="flex-grow-1 flex-row" style="flex-wrap:wrap" v-if="form.type=='radio'">
                    <view @tap="$emit('selectForm',$event)" :class="['default', v.is_selected==1?'d-active':'']" :data-form-id="formId" :data-index="index" :data-k="k" v-for="(v,k) in form.default_list" :key="v.id">{{v.name}}</view>
                </view>
                <view class="flex-grow-1 flex-row" style="flex-wrap:wrap" v-if="form.type=='checkbox'">
                    <view @tap="$emit('selectForm',$event)" :class="['default', v.is_selected==1?'d-active':'']" :data-form-id="formId" :data-index="index" :data-k="k" style="border-radius:0" v-for="(v,k) in form.default_list" :key="v.id">{{v.name}}</view>
                </view>
                <block v-if="form.type=='uploadImg'">
                    <view @tap="$emit('uploadImg',$event)" class="flex-grow-1 flex-y-center" :data-form-id="formId" :data-index="index">
                        <view style="text-align:right;width:100%;font-size:0" v-if="form.default">
                            <image mode="aspectFit" :src="form.default" style="width:88upx;height:96upx"></image>
                        </view>
                        <view style="text-align:right;width:100%;color:#c9c9c9;" v-else>
                            <view>{{form.tip?form.tip:'请选择图片'}}</view>
                        </view>
                    </view>
                    <view class="flex-grow-0 flex-y-center">
                        <image :src="__wxapp_img.balance.right.url" style="width:12upx;height:18upx;margin-left:18upx;"></image>
                    </view>
                </block>
            </view>
        </view>
    </view>
	</view>
</template>

<script>var myVue = {};
	export default {
		props:['__wxapp_img','item'],
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>

</style>
